package cn.yymc.controller;


import cn.yymc.pojo.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
public class SearchController {

    @Value("${server.port}")
    private String port;

    @GetMapping("/search")
    public String test01() {
     //   int i = 1 / 0;
        return "03-search" + port;
    }

    @PostMapping("/search/findAll")
    @ResponseBody
    public User findAll(@RequestBody User user) {
        return user;
    }

    @GetMapping("/search/findById/{id}")
    @ResponseBody
    public User findById(@PathVariable (value = "id") Integer  id) {
        int i = 1 / 0;
        return new User(id,"小杨","郑州");
    }

    @GetMapping("/szull")
    public String tet(){

        return "search里面的测试zull 忽略时候的方法";
    }

}
